package cn.xuanxuanyuhua.crm.domain;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
public class SystemDictionaryItem extends BaseDomain {
    private Long parentId ;

    private String title;

    private Integer sequence;

    public String getJson() throws JsonProcessingException {
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("parentId",parentId);
        map.put("title",title);
        map.put("sequence",sequence);
        ObjectMapper mapper = new ObjectMapper();
        return mapper.writeValueAsString(map);
    }

}